// 品牌相关操作
import request,{Method} from '@/libs/api.js'

// 获取全部的品牌
export function getAllBrand(){
    return request({
        url : `/product/brand/getAllBrand`,
        method: Method.GET,
    })
}

// 根据分类Id获取品牌和分类的关联数据
export function getCateBrandRelation(cateId){
    return request({
        url : `/product/categorybrandrelation/getCateBrandRelation/${cateId}`,
        method: Method.GET,
    })
}

// 获取品牌分页
export function getBrandPage (params) {
    return request({
      url: '/product/brand/getBrandPage',
      method: Method.POST,
      data: params
    });
}

// 添加品牌
export function addBrand (params) {
    return request({
      url: '/product/brand/addBrand',
      method: Method.POST,
      data: params
    });
}

// 修改品牌信息
export function editBrand (params) {
    return request({
      url: '/product/brand/editBrand',
      method: Method.PUT,
      data: params
    });
}

// 修改品牌信息
export function disableBrand (brandId) {
    return request({
      url: `/product/brand/disableBrand/${brandId}`,
      method: Method.PUT,
    });
}

// 修改品牌信息
export function enableBrand (brandId) {
    return request({
      url: `/product/brand/enableBrand/${brandId}`,
      method: Method.PUT,
    });
}

// 删除品牌
export function deleteBrand (brandId) {
    return request({
      url: `/product/brand/deleteBrand/${brandId}`,
      method: Method.DELETE,
    });
}